package cn;

import com.fz.dao.BookDAO;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;

/**
 * Created by webrx on 2017-09-12.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:applicationContext.xml"})
public class MyUser {
    //@Autowired
    //protected BookDAO bdao;

    //@Resource(name = "abc")
    //private BookDAO bdao;

    @Autowired
    private SqlSession session;

    @Test
    public void ss(){
        System.out.println(session);
    }

    @Resource
    private BookDAO bdao;

    @Test
    public void t1(){
        System.out.println(bdao.queryById(6));
    }
}
